package com.archive.manage.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.archive.common.annotation.Log;
import com.archive.common.core.controller.BaseController;
import com.archive.common.core.domain.AjaxResult;
import com.archive.common.enums.BusinessType;
import com.archive.manage.domain.StuArchiveArchiveLog;
import com.archive.manage.service.IStuArchiveArchiveLogService;
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.common.core.page.TableDataInfo;

/**
 * 学生档案-操作日志关联表Controller
 * 
 * @author marioduan
 * @date 2025-04-03
 */
@RestController
@RequestMapping("/manage/StuArchiveArchiveLog")
public class StuArchiveArchiveLogController extends BaseController
{
    @Autowired
    private IStuArchiveArchiveLogService stuArchiveArchiveLogService;

    /**
     * 查询学生档案-操作日志关联表列表
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:list')")
    @GetMapping("/list")
    public TableDataInfo list(StuArchiveArchiveLog stuArchiveArchiveLog)
    {
        startPage();
        List<StuArchiveArchiveLog> list = stuArchiveArchiveLogService.selectStuArchiveArchiveLogList(stuArchiveArchiveLog);
        return getDataTable(list);
    }

    /**
     * 导出学生档案-操作日志关联表列表
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:export')")
    @Log(title = "学生档案-操作日志关联表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, StuArchiveArchiveLog stuArchiveArchiveLog)
    {
        List<StuArchiveArchiveLog> list = stuArchiveArchiveLogService.selectStuArchiveArchiveLogList(stuArchiveArchiveLog);
        ExcelUtil<StuArchiveArchiveLog> util = new ExcelUtil<StuArchiveArchiveLog>(StuArchiveArchiveLog.class);
        util.exportExcel(response, list, "学生档案-操作日志关联表数据");
    }

    /**
     * 获取学生档案-操作日志关联表详细信息
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(stuArchiveArchiveLogService.selectStuArchiveArchiveLogById(id));
    }

    /**
     * 新增学生档案-操作日志关联表
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:add')")
    @Log(title = "学生档案-操作日志关联表", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody StuArchiveArchiveLog stuArchiveArchiveLog)
    {
        return toAjax(stuArchiveArchiveLogService.insertStuArchiveArchiveLog(stuArchiveArchiveLog));
    }

    /**
     * 修改学生档案-操作日志关联表
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:edit')")
    @Log(title = "学生档案-操作日志关联表", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody StuArchiveArchiveLog stuArchiveArchiveLog)
    {
        return toAjax(stuArchiveArchiveLogService.updateStuArchiveArchiveLog(stuArchiveArchiveLog));
    }

    /**
     * 删除学生档案-操作日志关联表
     */
    @PreAuthorize("@ss.hasPermi('manage:StuArchiveArchiveLog:remove')")
    @Log(title = "学生档案-操作日志关联表", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(stuArchiveArchiveLogService.deleteStuArchiveArchiveLogByIds(ids));
    }
}
